<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${cxt }/">
<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/newessay_draft.css" />
		<script src="js/jquery-1.11.3.min.js"></script>
		<script>
			$(function(){
				$(".draftwrap [blogid]").click(function(){
					alert($(this).attr("href")+"?blogid="+$(this).attr("blogid"));
					$(this).attr("href",$(this).attr("href")+"?blogid="+$(this).attr("blogid")+"&status=d");
					return true;
				});
				$(".delete").click(function(){
					var _this=this;
					$.ajax({
						url:"deleteblog",
						type:"get",
						data:{blogid:$(_this).parents("tr").find("[blogid]").attr("blogid")},
						success:function(data){
							$(_this).parents("tr").remove();
						}
					})
				})
			})
		</script>
</head>
<body>
		<table class="draftwrap" cellspacing="0" cellpadding="0" border="0">
			<thead>
				<tr style="border:1px solid #f11;">
					<th class="post-title" style="text-align: left;">标题</th>
					<th class="publish-status">发布状态</th>
					<th>评论数</th>
					<th>阅读数</th>
					<th>操作</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="item" items="${ drafts}">
				<tr>
					<td><a href="personalcenter/detail"  target="_blank" blogid="${item.article_id }">${item.article_title }</a>（${item.article_time }）</td>
					<td>未发布</td>
					<td>${item.article_discussnumber}</td>
					<td>${item.article_readnumber }</td>
					<td><button>编辑</button></td>
					<td><button class="delete">删除</button></td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
</body>
</html>